////////////////////////////////////////////////////////////
// Workfile : Door.cpp
// Author : Andreas Lehner
// Date : 29.10.2012
// Description : class Door holds information about a door
// it is able to print a door and set it opened or closed
// it can have a neighbour room, which it connects
// can be cloned for room copies	IMPLEMENTATION
// Remarks : 0
// Revision : 1
////////////////////////////////////////////////////////////
#include "Door.h"

//print a door in the middle position of one side
//print an element of a wall at other positions
void Door::Print(size_t pos) const{
	if (pos == Side::getLength() / 2){
		std::cout << "D";
	}else{
		std::cout << "*";
	}
}
//set a room neighbour
void Door::setNeighbour(Room* neighbour){
	mNeighbour = neighbour;
}
//return if door connects two rooms
bool Door::hasNeighbour() const{
	return (mNeighbour == 0) ? false : true;
}
//set a Door opened or closed
void Door::setOpened(bool opened){
	mOpened = opened;
}
//return if Door is opened
bool Door::isOpenend() const{
	return mOpened;
}
//clone a door for copying a room
Side* Door::clone() const{
	return new Door(getLength());
}